<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\facade\Route;

Route::group("admin",function(){
	Route::post("login",'Admin/login');
	Route::post("logout",'Admin/logout');
	Route::get("show",'Admin/show');
    Route::post("add",'Admin/add');
    Route::get("lists",'Admin/list');
    Route::get(":id",'Admin/info');
    Route::post(":id",'Admin/update');
    Route::post("delete/:id","Admin/delete");
})->pattern(['id' => '[0-9]+']);

Route::group("common",function() {
    Route::get("province","Common/province");
    Route::get("city","Common/city");
    Route::get("area","Common/area");
})->pattern(['id' => '[0-9]+']);


Route::group("users",function(){
    Route::get("lists","User/list");
    Route::get(':id','User/detail');
    Route::get('addresslists/:id','User/addressLists');
    Route::get('creditlists/:id','User/creditLists');
    Route::get('donatelists/:id','User/donateLists');
    Route::get('answerlists/:id','User/answerLists');
    Route::post('changecredit/:id','User/changeCredit');
    Route::post('export','User/export');
})->pattern(['id' => '[0-9]+']);

/** broadcasts 开始 **/
Route::group('broadcasts',function () {
    Route::get('lists', 'Broadcast/lists');
    Route::get('positions', 'Broadcast/getPosition');
    Route::get(':id', 'Broadcast/detail');
    Route::post(':id', 'Broadcast/update');
    Route::post('delete/:id', 'Broadcast/delete');
    Route::post('add', 'Broadcast/add');
    Route::post('enable/:id', 'Broadcast/enable');
    Route::post('disable/:id', 'Broadcast/disable');
})->pattern(['id' => '[0-9]+']);
/** broadcasts 结束 **/

/** goods 开始 **/
Route::group('goods',function () {
    Route::get('lists', 'Goods/lists');
    Route::get('models', 'Goods/getModels');
    Route::get(':id', 'Goods/detail');
    Route::post(':id', 'Goods/update');
    Route::post('add', 'Goods/add');
    Route::post('enable/:id', 'Goods/enable');
    Route::post('disable/:id', 'Goods/disable');
})->pattern(['id' => '[0-9]+']);
/** goods 结束 **/

/** organization 开始 **/
Route::group('organizations',function () {
    Route::get('lists', 'Organization/lists');
    Route::get(':id', 'Organization/detail');
    Route::post(':id', 'Organization/update');
    Route::post('add', 'Organization/add');
    Route::post('enable/:id', 'Organization/enable');
    Route::post('disable/:id', 'Organization/disable');
    Route::get('donatelists/:id', 'Organization/donateLists');
})->pattern(['id' => '[0-9]+']);
/** organization 结束 **/

/** activities 开始 **/
Route::group('activities',function () {
    Route::get('lists', 'Activity/lists');
    Route::get(':id', 'Activity/detail');
    Route::post(':id', 'Activity/update');
    Route::post('add', 'Activity/add');
    Route::post('enable/:id', 'Activity/enable');
    Route::post('disable/:id', 'Activity/disable');
    Route::get('enlists', 'ActivityEnlist/lists');
})->pattern(['id' => '[0-9]+']);
/** activities 结束 **/

/** linkers 开始 **/
Route::group('linkers',function () {
    Route::get('lists', 'Linker/lists');
    Route::get(':id', 'Linker/detail');
    Route::post(':id', 'Linker/update');
    Route::post('add', 'Linker/add');
    Route::post('enable/:id', 'Linker/enable');
    Route::post('disable/:id', 'Linker/disable');
})->pattern(['id' => '[0-9]+']);
/** linkers 结束 **/

/** questions 开始 **/
Route::group('questions',function () {
    Route::get('lists', 'Question/lists');
    Route::get(':questionId', 'Question/detail');
    Route::post(':questionId', 'Question/update');
    Route::post('delete/:questionId', 'Question/delete');
    Route::post('add', 'Question/add');
    Route::post('enable/:questionId', 'Question/enable');
    Route::post('disable/:questionId', 'Question/disable');
})->pattern(['questionId' => '[0-9]+']);
/** questions 结束 **/

Route::group("orders",function() {
    Route::get("lists","Order/index");
    Route::get("detail","Order/detail");
    Route::post("express","Order/express");
    Route::post("export","Order/export");
})->pattern(['id' => '[0-9]+']);

Route::group("gdzyz",function() {
    Route::get("lists","Gdzyz/lists");
    Route::post("synchro","Gdzyz/synchro");
    Route::get("getconfig","Gdzyz/config");
    Route::post("updateconfig","Gdzyz/updateConfig");
    Route::post("updatecode","Gdzyz/updateCode");
})->pattern(['id' => '[0-9]+']);

Route::group("gdzyz/school",function() {
    Route::get("lists","GdzyzSchool/lists");
    Route::get(":id","GdzyzSchool/detail");
    Route::post("add","GdzyzSchool/add");
    Route::post(":id","GdzyzSchool/update");
    Route::post("delete/:id","GdzyzSchool/delete");
})->pattern(['id' => '[0-9]+']);

Route::group("config",function() {
    Route::get("all","Config/index");
    Route::post("update","Config/update");
})->pattern(['id' => '[0-9]+']);